<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibQQt: R:/Develop/a0-develop/LibQQt/src/core/qqtobjectmanager.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibQQt
   &#160;<span id="projectnumber">v3.1</span>
   </div>
   <div id="projectbrief">开源、跨平台Qt应用程序框架中间件</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.html">core</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">qqtobjectmanager.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef QQTOBJECTMANAGER_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define QQTOBJECTMANAGER_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;QObject&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;QByteArray&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;QMetaObject&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &lt;QHash&gt;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;QList&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;QListIterator&gt;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;QWidget&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;qqt-local.h&quot;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;qqtcore.h&quot;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;QQTSHARED_EXPORT <span class="keywordtype">bool</span> <a class="code" href="class_qt_soap_q_name.html#a324bad744351599e14ab87bab8e574a6">operator&lt; </a>(  QByteArray&amp; l,  QByteArray&amp; r );</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;QQTSHARED_EXPORT <span class="keywordtype">bool</span> <a class="code" href="class_qt_soap_q_name.html#a92f65e83e578dc8162316a1c1d8fbcf6">operator== </a>(  QByteArray&amp; l,  QByteArray&amp; r );</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">class</span> ObjectType&gt;</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="class_____q_qt_object_factory____.html">   28</a></span>&#160;<span class="keyword">class </span>QQTSHARED_EXPORT <a class="code" href="class_____q_qt_object_factory____.html">__QQtObjectFactory__</a></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;{</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> dst_type, <span class="keyword">typename</span> src_type&gt;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="class_____q_qt_object_factory____.html#a25df0d6e1a24fd1a9c263768aad1e201">   38</a></span>&#160;    <span class="keyword">static</span> dst_type <a class="code" href="class_____q_qt_object_factory____.html#a25df0d6e1a24fd1a9c263768aad1e201">pointer_cast</a> ( src_type src ) {</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        <span class="keywordflow">return</span> *<span class="keyword">static_cast&lt;</span>dst_type*<span class="keyword">&gt;</span> ( <span class="keyword">static_cast&lt;</span><span class="keywordtype">void</span>*<span class="keyword">&gt;</span> ( &amp;src ) );</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    }</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> registerObject() {</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="comment">/*</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">         * 将生成此类对象的具体（非模板）函数注册进Hash</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment">         */</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <span class="keywordtype">void</span>* a = pointer_cast&lt;<span class="keywordtype">void</span>*&gt; ( &amp;__QQtObjectFactory__::constructorHelper&lt;T&gt; );</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="comment">//pline() &lt;&lt; a;</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        Constructor* constructor = ( Constructor* ) a;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        <span class="comment">//pline() &lt;&lt; constructor;</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        constructors().insert ( T::staticMetaObject.className(), constructor );</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    }</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="class_____q_qt_object_factory____.html#a03b47defef4d5bb4e167ecda34e041cc">   59</a></span>&#160;    <span class="keyword">static</span> ObjectType* <a class="code" href="class_____q_qt_object_factory____.html#a03b47defef4d5bb4e167ecda34e041cc">createObject</a> ( <span class="keyword">const</span> QByteArray&amp; className, ObjectType* parent = NULL ) {</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <span class="comment">/*</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">         * 搜索生成此类对象的函数</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">         */</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        <span class="comment">//pline() &lt;&lt; constructors();</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        Constructor* constructor = 0;<span class="comment">//constructors().value( ( className, 0 );</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        QMapIterator&lt;QByteArray, Constructor*&gt; itor ( constructors() );</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <span class="comment">//pline() &lt;&lt; constructors().isDetached();</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keywordflow">while</span> ( itor.hasNext() ) {</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;            itor.next();</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;            <span class="comment">//pline() &lt;&lt; itor.key() &lt;&lt; itor.value();</span></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">#if 0</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            QByteArray cc;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            QByteArray dd;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            cc = itor.key();<span class="comment">//?</span></div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;            dd = className;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            pline() &lt;&lt; cc &lt;&lt; dd;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;            <span class="keywordflow">if</span> ( cc == dd ) <span class="comment">//??? 不能比较吗？能，但是必须加bool转换。</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                constructor = itor.value();</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            pline() &lt;&lt; className &lt;&lt; itor.key() &lt;&lt; itor.value();</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;            <span class="comment">//pline() &lt;&lt; ( bool ) ( className == itor.key() );</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;            <span class="keywordflow">if</span> ( ( <span class="keywordtype">bool</span> ) ( className == itor.key() ) ) {</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;                constructor = itor.value();</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;            }</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        }</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <span class="comment">//pline() &lt;&lt; constructor;</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        <span class="keywordflow">if</span> ( constructor == NULL )</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;            <span class="keywordflow">return</span> NULL;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        <span class="comment">//pline() &lt;&lt; *constructor;</span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        <span class="comment">//pline() &lt;&lt; **constructor;</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <span class="comment">//pline() &lt;&lt; &amp;*constructor;</span></div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <span class="comment">//pline() &lt;&lt; &amp;constructor;</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        <span class="comment">//pline() &lt;&lt; *&amp; constructor;</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <span class="comment">/*</span></div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="comment">         * 生成对象,调用的是constructorHelper&lt;className&gt;(parent)</span></div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="comment">         */</span></div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        Constructor* a = pointer_cast&lt;Constructor*&gt; ( &amp;constructor );</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        <span class="comment">//pline() &lt;&lt; a &lt;&lt; *a;</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        <span class="keywordflow">return</span> ( *a ) ( parent );</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    }</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keyword">typedef</span> ObjectType* ( *Constructor ) ( ObjectType* parent );</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keyword">static</span> ObjectType* constructorHelper ( ObjectType* parent = 0 ) {</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        <span class="comment">//pline() &lt;&lt; &quot;created &quot;;</span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">new</span> T ( parent );</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    }</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keyword">static</span> QMap&lt;QByteArray, Constructor*&gt;&amp; constructors() {</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        <span class="comment">/*</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="comment">         * 保存生成类对象的具体（非模板）函数</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="comment">         * 这个变量是全局的。</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="comment">         * 无论是否使用静态函数包裹，这个变量用于是全局的，一直存在，不受类的实例存在与否控制。</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="comment">         */</span></div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        <span class="keyword">static</span> QMap&lt;QByteArray, Constructor*&gt; instance;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        <span class="keywordflow">return</span> instance;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    }</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;};</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="keyword">typedef</span> <a class="code" href="class_____q_qt_object_factory____.html">__QQtObjectFactory__&lt;QObject&gt;</a> <a class="code" href="class_____q_qt_object_factory____.html">QQtObjectFactory</a>;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="keyword">typedef</span> <a class="code" href="class_____q_qt_object_factory____.html">__QQtObjectFactory__&lt;QWidget&gt;</a> <a class="code" href="class_____q_qt_object_factory____.html">QQtWidgetFactory</a>;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="class_q_qt_object_manager.html">  143</a></span>&#160;<span class="keyword">class </span>QQTSHARED_EXPORT <a class="code" href="class_q_qt_object_manager.html">QQtObjectManager</a></div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;{</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="class_q_qt_object_manager.html#a43c7c39865f1dbcbcbecafcf21f76660">  150</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_q_qt_object_manager.html#a43c7c39865f1dbcbcbecafcf21f76660">registerObject</a> ( <span class="keyword">const</span> QObject* <span class="keyword">const</span>&amp; w ) {</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        <span class="keywordflow">if</span> ( !containers().contains ( w ) )</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;            <span class="keywordflow">return</span>;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        containers().push_back ( w );</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    }</div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="class_q_qt_object_manager.html#a4136029b539fb6ddd09a3473237721fa">  159</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_q_qt_object_manager.html#a4136029b539fb6ddd09a3473237721fa">unregisterObject</a> ( <span class="keyword">const</span> QObject* <span class="keyword">const</span>&amp; w ) {</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        QListIterator&lt;const QObject*&gt; itor ( containers() );</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        <span class="keywordflow">while</span> ( itor.hasNext() ) {</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;            <span class="keyword">const</span> QObject* ww = itor.next();</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;            <span class="keywordflow">if</span> ( ww == w ) {</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;                containers().removeOne ( w );</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;                <span class="keywordflow">break</span>;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;            }</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        }</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    }</div><div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="class_q_qt_object_manager.html#a3046f21752fc45777510b13b918a2a96">  176</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">const</span> QObject* <a class="code" href="class_q_qt_object_manager.html#a3046f21752fc45777510b13b918a2a96">registeredObject</a> ( <span class="keyword">const</span> QByteArray&amp; objName ) {</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        QListIterator&lt;const QObject*&gt; itor ( containers() );</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        <span class="keywordflow">while</span> ( itor.hasNext() ) {</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;            <span class="keyword">const</span> QObject* ww = itor.next();</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;            <span class="keywordflow">if</span> ( ww-&gt;objectName() == objName ) {</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;                <span class="keywordflow">return</span> ww;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;            }</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        }</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    }</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="comment">//包裹一下，有利于省却全局声明。</span></div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <span class="comment">//强调：这个static不论是否被静态成员函数包裹，永远存在。</span></div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="comment">//类不决定生存周期。</span></div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <span class="comment">//类决定作用域。</span></div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="keyword">static</span> QList&lt;const QObject*&gt;&amp; containers() {</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        <span class="keyword">static</span> QList&lt;const QObject*&gt; instance;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        <span class="keywordflow">return</span> instance;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    }</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;};</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;<span class="preprocessor">#endif // QQTOBJECTMANAGER_H</span></div><div class="ttc" id="class_____q_qt_object_factory_____html"><div class="ttname"><a href="class_____q_qt_object_factory____.html">__QQtObjectFactory__</a></div><div class="ttdef"><b>Definition:</b> qqtobjectmanager.h:28</div></div>
<div class="ttc" id="class_qt_soap_q_name_html_a92f65e83e578dc8162316a1c1d8fbcf6"><div class="ttname"><a href="class_qt_soap_q_name.html#a92f65e83e578dc8162316a1c1d8fbcf6">QtSoapQName::operator==</a></div><div class="ttdeci">bool operator==(const QtSoapQName &amp;s1, const QtSoapQName &amp;s2)</div><div class="ttdef"><b>Definition:</b> qtsoap.cpp:225</div></div>
<div class="ttc" id="class_q_qt_object_manager_html_a4136029b539fb6ddd09a3473237721fa"><div class="ttname"><a href="class_q_qt_object_manager.html#a4136029b539fb6ddd09a3473237721fa">QQtObjectManager::unregisterObject</a></div><div class="ttdeci">static void unregisterObject(const QObject *const &amp;w)</div><div class="ttdoc">unregisterObject 取消对象在工厂中注册 </div><div class="ttdef"><b>Definition:</b> qqtobjectmanager.h:159</div></div>
<div class="ttc" id="class_____q_qt_object_factory_____html_a25df0d6e1a24fd1a9c263768aad1e201"><div class="ttname"><a href="class_____q_qt_object_factory____.html#a25df0d6e1a24fd1a9c263768aad1e201">__QQtObjectFactory__::pointer_cast</a></div><div class="ttdeci">static dst_type pointer_cast(src_type src)</div><div class="ttdef"><b>Definition:</b> qqtobjectmanager.h:38</div></div>
<div class="ttc" id="class_q_qt_object_manager_html"><div class="ttname"><a href="class_q_qt_object_manager.html">QQtObjectManager</a></div><div class="ttdoc">The QQtObjectManager class QQt 对象管理器 用于管理Qt对象实例。 曾用名 QQtObjectParcel. </div><div class="ttdef"><b>Definition:</b> qqtobjectmanager.h:143</div></div>
<div class="ttc" id="class_q_qt_object_manager_html_a43c7c39865f1dbcbcbecafcf21f76660"><div class="ttname"><a href="class_q_qt_object_manager.html#a43c7c39865f1dbcbcbecafcf21f76660">QQtObjectManager::registerObject</a></div><div class="ttdeci">static void registerObject(const QObject *const &amp;w)</div><div class="ttdoc">registerObject 将对象注册进工厂 </div><div class="ttdef"><b>Definition:</b> qqtobjectmanager.h:150</div></div>
<div class="ttc" id="class_qt_soap_q_name_html_a324bad744351599e14ab87bab8e574a6"><div class="ttname"><a href="class_qt_soap_q_name.html#a324bad744351599e14ab87bab8e574a6">QtSoapQName::operator&lt;</a></div><div class="ttdeci">bool operator&lt;(const QtSoapQName &amp;s1, const QtSoapQName &amp;s2)</div><div class="ttdef"><b>Definition:</b> qtsoap.cpp:249</div></div>
<div class="ttc" id="class_q_qt_object_manager_html_a3046f21752fc45777510b13b918a2a96"><div class="ttname"><a href="class_q_qt_object_manager.html#a3046f21752fc45777510b13b918a2a96">QQtObjectManager::registeredObject</a></div><div class="ttdeci">static const QObject * registeredObject(const QByteArray &amp;objName)</div><div class="ttdoc">registeredObject 根据对象名（ObjectName）查找注册的对象。 </div><div class="ttdef"><b>Definition:</b> qqtobjectmanager.h:176</div></div>
<div class="ttc" id="class_____q_qt_object_factory_____html_a03b47defef4d5bb4e167ecda34e041cc"><div class="ttname"><a href="class_____q_qt_object_factory____.html#a03b47defef4d5bb4e167ecda34e041cc">__QQtObjectFactory__::createObject</a></div><div class="ttdeci">static ObjectType * createObject(const QByteArray &amp;className, ObjectType *parent=NULL)</div><div class="ttdoc">createObject 根据对象类型（类名）生成类对象实例 </div><div class="ttdef"><b>Definition:</b> qqtobjectmanager.h:59</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
